//第二层axios封装  账号管理模块,所有用户管理模块的接口 
import request from '@/utils/request.js' //引入增强过后的axios

//登录接口的函数
export const chenkLogin = (data) => {
    return request({
        method: 'post',
        url: '/users/checkLogin',
        data,
    });
}

//获取用户数据列表
export const userList = (params) => {
    return request({
        method: 'get',
        url: '/users/list',
        params,
    });
}

//检测账号是否存在
export const userRepeat = (data) => {
    return request({
        method: 'post',
        url: '/users/repeat',
        data,
    });
}

//添加账号
export const userAdd = (data) => {
    return request({
        method: 'post',
        url: '/users/add',
        data,
    });
}

//删除账号
export const userDel = (params) => {
    return request({
        method: 'get',
        url: '/users/del',
        params,
    });
}


//修改账号
export const userEdit = (data) => {
    return request({
        method: 'post',
        url: '/users/edit',
        data,
    });
}

//检查旧密码是否正确
export const checkOldpwd = (params) => {
    return request({
        method: 'get',
        url: '/users/checkoldpwd',
        params,
    });
}

//修改密码
export const editPwd = (data) => {
    return request({
        method: 'post',
        url: '/users/editpwd',
        data,
    });
}

//获取账号信息
export const suerInfo = (params) => {
    return request({
        method: 'get',
        url: '/users/info',
        params,
    });
}

//修改头像
export const avatarEdit = (params) => {
    return request({
        method: 'get',
        url: '/users/avataredit',
        params,
    });
}


